package com.cskaoyan.com.collection.arraylist;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class DemoArrayList4 {
    public static void main(String[] args) {

        ArrayList<String> list = new ArrayList<>();
        list.add("zs");
        list.add("ls");
        list.add("wu");
        list.add("zl");

        // zs  ls  wu zl
        //  ls  wu
        List<String> strings = list.subList(1, 3);



        Iterator<String> iterator = list.iterator();

        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }


    }
}
